Skip to content

Allow unparented WxRenderWidget #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
Merged

Allow unparented WxRenderWidget #92

merged 2 commits into from
Jun 26, 2025

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented May 22, 2025

Closes #91 cc @tlambert03

@tlambert03
Copy link
Contributor

tlambert03 commented May 22, 2025

This is fine, however, there’s shouldn’t be technically anything wrong with creating an unparented widget and then reparenting it before starting the event loop right?

Thats what I had been doing and why this warning sorta misses the point (which is more that rendercanvas doesn’t support that mode of operation… even if you didn’t intend to use it as a top widget)

the key reason that that is an unsupported mode is because of operations performed by renderwidget in the init (not because of a problem with an temporarily unparented widget in wxpython). So the warning should perhaps say “render widget requires a parent at the time of instantiation” rather than assuming it was going to be a top level widget

@Vipitis
Copy link
Contributor

Vipitis commented May 22, 2025

I think the same is also true for QRenderWidget I had imported that instead of RenderCanvas and I had to kill the terminal to recover.

@almarklein
Copy link
Member Author

there’s shouldn’t be technically anything wrong with creating an unparented widget and then reparenting it before starting the event loop right?

Good point! I tweaked the code so that it allows a (temporary) unparented widget. Could you try and see if it works with what you were trying?

@almarklein almarklein changed the title Warn for inproper use of WxRenderWidget Allow unparented WxRenderWidget Jun 26, 2025
@almarklein almarklein merged commit f948375 into main Jun 26, 2025
13 checks passed
@almarklein almarklein deleted the wx branch June 26, 2025 11:30
@almarklein
Copy link
Member Author

I'm assuming this works, let me know if more is needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WxRenderWidget cannot be used on its own (segfault)
3 participants